package com.stuManager.model;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/*
    通用网络返回数据模型，
    包含参数
    errorCode  错误代码
    message    返回信息
    result     具体的返回数据
 */
public class CommonResponseModel {
    private int errorCode;
    private String message;
    //json对象
    private Object result;

    public CommonResponseModel(int errorCode, String message, JSONObject result) {
        this.errorCode = errorCode;
        this.message = message;
        this.result = result;
    }

    public CommonResponseModel() {
    }

    public CommonResponseModel(int errorCode, String message) {
        this.errorCode = errorCode;
        this.message = message;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    @Override
    public String toString() {
        return "CommonResponseModel{" +
                "errorCode=" + errorCode +
                ", message='" + message + '\'' +
                ", result=" + result +
                '}';
    }
}
